#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class QSystemTrayIcon;
class MyTask;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void on_new_clicked();
    void on_remove_clicked();
    void on_help_clicked();

    void on_selected_item_changed();

private:
    void save_tasks() const;
    void load_tasks();

    void add_task(MyTask *ptask);

    void enable_settings(bool enable);

protected:
    void closeEvent(QCloseEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;

signals:
    void task_changed(int index);

private:
    Ui::MainWindow *ui;

    QSystemTrayIcon *trayIcon;
};
#endif // MAINWINDOW_H
